<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title>{$Think.lang.ato_add_page_title} - {$Think.lang.cfg_website}</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="{$NOW_THEME_URL}/Assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/plugins/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style-metro.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/themes/{:session('skin')}.css" rel="stylesheet" type="text/css" id="style_color"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN PAGE LEVEL STYLES -->
	<!-- END PAGE LEVEL STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<include file="Public:header" />
	<!-- END HEADER -->
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<div class="page-sidebar nav-collapse collapse">
			<!-- BEGIN SIDEBAR MENU -->        
			<ul class="page-sidebar-menu">
            	<li>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
					<div class="sidebar-toggler hidden-phone"></div>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
				</li>
                {$menu_tree}
            </ul>
			<!-- END SIDEBAR MENU -->
		</div>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div id="portlet-config" class="modal hide">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button"></button>
					<h3>portlet Settings</h3>
				</div>
				<div class="modal-body">
					<p>Here will be a configuration form</p>
			  </div>
			</div>
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN PAGE CONTAINER-->
			<div class="container-fluid">
				<!-- BEGIN PAGE HEADER-->   
			  <div class="row-fluid">
					<div class="span12">
                    	<div class="clear">&nbsp;</div>                        
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="__APP__">{$Think.lang.cfg_page_home}</a> 
								<span class="icon-angle-right"></span>
							</li>
							<li>
								<a href="__URL__">{$Think.lang.ato_page_title}</a> 
								<span class="icon-angle-right"></span>
						  </li>
							<li><a href="#">{$Think.lang.ato_add_page_title}</a></li>
						</ul>
					</div>
				</div>
				<!-- END PAGE HEADER-->
				<!-- BEGIN PAGE CONTENT-->
				<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN VALIDATION STATES-->
						<div class="portlet box purple">
							<div class="portlet-title">
								<div class="caption"><i class="icon-plus"></i>{$Think.lang.ato_add_page_title}</div>
								<div class="tools">
									<a href="javascript:;" class="collapse"></a>
								</div>
							</div>
							<div class="portlet-body form">
								<!-- BEGIN FORM-->
								<form action="__URL__/add" method="post" id="adcontentForm" 
                                 class="form-horizontal form-bordered form-row-stripped">
                                 <input type="hidden" name="solevar" value="{:create_id()}"/>
									<div class="alert alert-error hide">
										<button class="close" data-dismiss="alert"></button>
										{$Think.lang.cfg_form_err_allform}
									</div>
									<div class="alert alert-success hide">
										<button class="close" data-dismiss="alert"></button>
										{$Think.lang.cfg_form_ok_allform}
									</div>
                                    <div class="tabbable tabbable-custom">
                                    <ul class="nav nav-tabs">
                                        <li class="active">
                                        	<a href="#tab_1_1" data-toggle="tab">
                                        		{$Think.lang.ato_form_tab_article}
                                        	</a>
                                        </li>
                                        {$arg|formReplyTab=###}
                                    </ul>
                                    <div class="tab-content">
                                        <!--tab1 start-->
                                        <div class="tab-pane active" id="tab_1_1">
                                        
                                    {$arg|eleSiteShow=###}<!--多站点支持-->
									{$arg|eleDeviceShow=###}<!--多终端支持-->
									{$lang|eleLangShow=###}<!--多语言支持-->
                                    
									<div class="control-group">
										<label class="control-label">{$Think.lang.ato_form_ele_cate_id}
                                        <span class="required">*</span></label>
										<div class="controls">
											<select class="span6 m-wrap" name="cateid">
												<option value="">{$Think.lang.cfg_form_tis_select}</option>
                                                {$selects}
											</select>
										</div>
									</div>
                                    
                                    <div class="control-group">
										<label class="control-label">{$Think.lang.ato_form_ele_title}
                                        <span class="required">*</span></label>
										<div class="controls">
											<input type="text" name="title" data-required="1" class="span6 m-wrap" 
                                            placeholder="请输入单页名称"/>
										</div>
									</div>
            
									<div class="control-group">
										<label class="control-label">{$Think.lang.ato_form_ele_keywords}
                                        <span class="required">*</span></label>
										<div class="controls">
											<input type="text" name="keywords" data-required="1" class="span6 m-wrap" 
                                             placeholder="请输入关键字"/>
										</div>
									</div>
                                    
                                    <div class="control-group">
										<label class="control-label"><?=L('cfg_upl_thumbpic')?><span class="required">*</span></label>
										<div class="controls">
											<a class="btn blue" id="uploadSinglePic" data-toggle="modal">
                                            <i class="icon-picture"></i> <?=L('cfg_upl_thumbpic_btn')?></a>
                                            <div class="clear"></div>
                                            <div id="singleBox" class="uploadPic_box">
                                            </div>
										</div>
									</div>
									
									<!-- <div class="control-group">
										<label class="control-label">{$Think.lang.cfg_upl_files_btn}
										<span class="required">*</span></label>
										<div class="controls">
											<a class="btn blue" id="uploadFile" data-toggle="modal">
                                            <i class="icon-plus"></i>{$Think.lang.cfg_upl_files_btn}</a>
                                            <div class="clear"></div>
                                            <div id="fileBox" class="uploadFile_box">
                                            </div>
										</div>
									</div> -->
                                    
                                    <div class="control-group">
										<label class="control-label">{$Think.lang.ato_form_ele_description}</label>
										<div class="controls">
                                          <textarea name="description" style="width:60%; height:120px;"></textarea>
										</div>
									</div>
                                    
                                    <div class="control-group">
										<label class="control-label">{$Think.lang.ato_form_ele_content}</label>
										<div class="controls">
                                          <textarea name="content" style="width:100%; height:400px;"></textarea>
										</div>
									</div>

									 </div>
                                        <!--tab1 end-->
                                        <!--tab2 start-->
										{$arg|formReplyEle=###}
                                        <!--tab2 end-->
                                    </div>
									<div class="form-actions">
										<button type="submit" class="btn purple">{$Think.lang.cfg_form_ele_submit}</button>
										<button type="reset" class="btn">{$Think.lang.cfg_form_ele_reset}</button>
									</div>
								</form>
								<!-- END FORM-->
							</div>
						</div>
						<!-- END VALIDATION STATES-->
					</div>
                    <!-- UploadPic STATES -->
                    <div class="modal hide fade uploadPic-modal" tabindex="-1" style="width:650px; height:420px;"></div>
                    <!-- UploadPic END -->
				</div>
				<!-- END PAGE CONTENT-->         
		  </div>
			<!-- END PAGE CONTAINER-->
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
	<include file="Public:footer" />
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->
	<script src="__PUBLIC__/Js/jquery.min.js" type="text/javascript"></script>
	<script src="{$NOW_THEME_URL}/Assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>   
	<script src="{$NOW_THEME_URL}/Assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<!--[if lt IE 9]>
	<script src="{$NOW_THEME_URL}/Assets/plugins/excanvas.min.js"></script>
	<script src="{$NOW_THEME_URL}/Assets/plugins/respond.min.js"></script>  
	<![endif]-->  
	<script src="{$NOW_THEME_URL}/Assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<!-- END CORE PLUGINS -->
    
    <!-- BEGIN XHEDITOR -->
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/xheditor/xheditor-1.2.1.min.js"></script>
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/xheditor/xheditor_lang/{$Think.LANG_SET}.js"></script>
    <!-- END XHEDITOR -->
    
    <!-- BEGIN UPLOADPIC-->
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/artdialog/jquery.artdialog.js?skin=bootstrap"></script>
	<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/artdialog/plugins/iframeTools.js"></script> 
    <!-- END UPLOADPIC-->
    
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/jquery-validation/localization/messages_{$Think.LANG_SET}.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
    
	<!-- BEGIN PAGE LEVEL STYLES -->
	<script src="{$NOW_THEME_URL}/Assets/scripts/app.js"></script>
	<script src="{$NOW_THEME_URL}/Assets/scripts/artonce/add.js"></script> 
    <script src="{$NOW_THEME_URL}/Assets/scripts/upload/pic.js"></script>
	<script src="{$NOW_THEME_URL}/Assets/scripts/upload/file.js"></script>
	<!-- END PAGE LEVEL STYLES -->    
	<script type="text/javascript">
		var ABS_URL_Theme = "{$NOW_THEME_URL}/";
		//UploadPic STATES CONSTANT
		var ABS_URL = "{$Think.TMPL_URL}/";
		var REL_URL = "{$Think.REL_URL}";
		//UploadPic END CONSTANT
		
		var vMessage = {};
		//用户添加表单的验证提示语言包
		vMessage.title_required       = '{$Think.lang.ato_form_validata_title_required}';
		vMessage.title_regex          = '{$Think.lang.ato_form_validata_title_regex}';
		vMessage.keywords_required    = '{$Think.lang.ato_form_validata_keywords_required}';
		vMessage.keywords_regex       = '{$Think.lang.ato_form_validata_keywords_regex}';
		vMessage.description_required = '{$Think.lang.ato_form_validata_description_required}';
		vMessage.description_regex    = '{$Think.lang.ato_form_validata_description_regex}';
		
		var jsLang = {};
		//用户添加表单的验证提示语言包
		jsLang.crop_title      = '{:L("cfg_upl_crop_title")}';
		jsLang.crop_false      = '{:L("cfg_upl_crop_false")}';
		jsLang.crop_noselect   = '{:L("cfg_upl_crop_noselect")}';
		jsLang.uploadSinglePic = '{:L("cfg_upl_thumbpic_btn")}';
		jsLang.uploadAtlasPic  = '{:L("cfg_upl_atlaspic_btn")}';
		jsLang.uploadFiles     = '<?=L("cfg_upl_files_btn")?>';

		var lang = "{:getLang()}";
		jQuery(document).ready(function() {   
		   // initiate layout and plugins
		   App.init();
		   adcontentForm.init();
		   
		   // initiate xheditor
		   $('textarea[name="content"]').xheditor({modalWidth:650,modalHeight:400,upBtnText:jsLang.uploadScan,
			   upLinkUrl:"!{$NOW_THEME_URL}/Assets/plugins/ckfinder/upload.html?type=File",
			   upImgUrl:"!{$NOW_THEME_URL}/Assets/plugins/ckfinder/upload.html?type=Photo",
			   upFlashUrl:"!{$NOW_THEME_URL}/Assets/plugins/ckfinder/upload.html?type=Flash",
			   upMediaUrl:"!{$NOW_THEME_URL}/Assets/plugins/ckfinder/upload.html?type=Media"}
		   );
		   uploadPic.init([
				{
					'btn':'uploadSinglePic',
					'title':jsLang.uploadSinglePic,
					'closeId':'singleBoxClose',
					'box':'singleBox',
					'ptype':'single',
					'field':'single'
				},
				{
					'btn':'uploadAtlasPic',
					'title':jsLang.uploadAtlasPic,
					'closeId':'atlasBoxClose',
					'box':'atlasBox',
					'ptype':'atlas',
					'field':'atlas'
				}
			],jsLang);
			
			uploadFile.init([
				{
					'btn':'uploadFile',
					'title':jsLang.uploadFiles,
					'box':'fileBox',
					'field':'attach'
				}
			],jsLang);
			get_select();
			$('select[name=lang]').bind('change',function(){
			  get_select($(this).val());
			});
			function get_select(lang){
				 var module  = 'Artonce';
				 var cateid  = "{$artonce['cateid']}";
				 $.get('{:U("Public/ajax")}', {'lang':lang,'module':module,cateid:cateid}, function(data){
					var option = "<option value='0' m='Artonce'>{$Think.lang.cfg_form_tis_select}</option>";
					$("select[name=cateid]").html(option+data);	
					$("select[name=cateid] option").each(function(){
						if(module!=$(this).attr("m")){
							$(this).remove();
						}
					});
				 },'json');
			}
		});
	</script>
	{$arg|formReplyJs=###}
	<!-- END JAVASCRIPTS -->   
</body>
<!-- END BODY -->
</html>